#
# Copyright 2013 The Imaging Source Europe GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


LDFLAGS+=@LDFLAGS@

CFLAGS+=@CFLAGS@

PLUGINS=libgsttiswhitebalance.so \
		libgsttisvideobufferfilter.so \
		libgsttiscolorize.so \
		libgsttis_auto_exposure.so


.PHONY: all

all: $(PLUGINS)


%.o: %.c
	$(CC) -Wall -g -O0 -fPIC $(CPPFLAGS) $(CFLAGS) -c -o $(patsubst %.c,%.o,$<) $<  $(LDFLAGS)

lib%.so: %.o image_sampling.o bayer.o
	$(CC) -shared -g -O0 -o $@ $^ $(LDFLAGS)



# ==================== Clean up and misc ====================

.PHONY: clean realclean distclean

clean:
	rm -f *.o *~ TAGS

realclean: clean
	$(RM) *.so

distclean: realclean
	$(RM) -r Makefile config.h config.status configure aclocal.m4 autom4te.cache autoscan.log

TAGS:
	etags *.[ch]

# ==================== Installation ====================

install: all
	install -D libgsttiswhitebalance.so $(HOME)/.gstreamer-0.10/plugins 
	install -D libgsttisvideobufferfilter.so $(HOME)/.gstreamer-0.10/plugins 
	install -D libgsttiscamerasrc.so $(HOME)/.gstreamer-0.10/plugins 
